﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ip = Nexus;
using Nexus.IPConfiguration.Management;

namespace IpConfigTest
{
    class Program
    {
        static void Main(string[] args)
        {
            NetworkAdapterFactory factory = new NetworkAdapterFactory();
            Console.WriteLine("List of network adapters");
            var adapters = factory.GetNetworkAdaptersCaptions();
            foreach (var a in adapters)
            {
                Console.WriteLine(a);
            }
            string adapter2 = adapters.First();
            var adapter = factory.GetNetworkAdapter(adapter2);
            adapter.SetDns(new string[] { "10.103.1.10", "10.103.1.11" });
            adapter.SetIp("10.105.2.6", "255.255.0.0", "10.105.0.1");
            adapter.Refresh();
            string proxyOverride = @"kag-w2-ts-02*;ip-of-ssd;10.1.1.55*;kpl-portal;172.16.143.210;172.16.142.10;komsamantis;KPL-*;my-portal-test;kag-w2-web-t1;komsaportal;kag-w2-web-02;newsklep-test.komsa.pl;ekomsa.pl;skaner;e-komsa.pl;10.110.1.16";
            SystemProxyManagement.EnableProxy("10.103.1.90", 80, proxyOverride);
            //adapter.EnableAutoDNS();
            //adapter.EnableDHCP();
            //adapter.Refresh();
            //SystemProxyManagement.DisableProxy();
            Console.WriteLine("Done");
            Console.ReadKey();
        }
    }
}
